<template>
    <div>
        <h2>欢迎访问Star Wish后台管理系统</h2>
        <hr>
        <div>
          <div style="width: 800px;height: 600px;" id="myDiv">

          </div>
        </div>



    </div>


</template>

<script>



    export default {
        name: "WelCome",
        data(){
          return{
          titleText:'一周浏览量```',
          weeks:["星期一","星期二","星期三","星期一四","星期五","星期六","星期日"]
          }
        },
        methods: {
          //初始化数据
          initEcharts(){
            let t = this.titleText;
            const options = {
              title:{
                text:t

              },
              tooltip:{},
              legend:{
                data:["计划浏览量","实际浏览量"]
              },
              xAxis:{
                data:this.weeks,
              },
              yAxis:{},
              series:[
                {
                  name:"计划浏览量",
                  data:[100,29,30,500,600,800,200],
                  type:"line"
                },
                {
                  name:"实际浏览量",
                  data:[90,40,50,450,700,650,500],
                  type:"line"
                }
              ]
            }
            let div =  document.getElementById("myDiv");
            //初始化
            let ec = this.$echarts.init(div);
            ec.setOption(options);
          }
        },
      mounted() {
          this.initEcharts();
      }
    }


</script>

<style scoped>


</style>
<style>

</style>